<html>
<head>
	<title>个人信息</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script language="javascript" src="../script/jquery.js"></script>
    <script language="javascript" src="../script/pageCommon.js" charset="utf-8"></script>
    <script language="javascript" src="../script/PageUtils.js" charset="utf-8"></script>
    <script language="javascript" src="../script/DemoData.js" charset="utf-8"></script>
	<script language="javascript" src="../script/DataShowManager.js" charset="utf-8"></script>
    <link type="text/css" rel="stylesheet" href="../style/blue/pageCommon.css" />
    <script type="text/javascript">
    </script>
</head>
<body>

<!-- 标题显示 -->
<div id="Title_bar">
    <div id="Title_bar_Head">
        <div id="Title_Head"></div>
        <div id="Title"><!--页面标题-->
            <img border="0" width="13" height="13" src="../style/images/title_arrow.gif"/> 个人信息
        </div>
        <div id="Title_End"></div>
    </div>
</div>

<!--显示表单内容-->
<div id=MainArea>
    <form action="editInfo" enctype="multipart/form-data" id="infom" method="post">
        <div class="ItemBlock_Title1"><!-- 信息说明<DIV CLASS="ItemBlock_Title1">
        	<IMG BORDER="0" WIDTH="4" HEIGHT="7" SRC="../style/blue/images/item_point.gif" /> 个人信息 </DIV>  -->
        </div>
        
        <!-- 表单内容显示 -->
        <div class="ItemBlockBorder">
            <div class="ItemBlock">
                <table cellpadding="0" cellspacing="0" class="mainForm">
					<tr>
                        <td width="150">用户ID（登录名）</td>
                        <td th:text="${session.user.account}"></td>
						<td rowspan="5" align="right">
							<img id ="tx" th:src = "${session.user.imgpath}" style="height: 150px;width: 150px"/>
						</td>
                    </tr>
                    <tr>
                        <td>学院</td>
                        <td th:text="${session.user.college}"></td>
                    </tr>
					<tr>
                        <td>专业 班级</td>
                        <td><span th:text="${session.user.major}"></span> &nbsp; <span th:text="${session.user.clas}"></span></td>
                    </tr>
					<tr>
                        <td>姓名</td>
                        <td th:text="${session.user.name}"></td>
                    </tr>
					<tr>
                        <td>头像</td>
                        <td><input type="file" name="image" class="InputStyle" style="width: 400px;" id="txx"/></td>
                    </tr>
                </table>
            </div>
        </div>
       
        <!-- 表单操作 -->
        <div id="InputDetailBar">
            <input type="image" src="../style/images/save.png" onclick="upload()"/>
            <a href="javascript:history.go(-1);"><img src="../style/images/goBack.png"/></a>
        </div>
    </form>
</div>

<div class="Description">
	验证规则：<br />
	1，可以修改自已的头像，在右侧是头像的预览。<br />
</div>
<script type="text/javascript">
	function upload(){
		$("#infom").submit();
	}
</script>
</body>
<script type="text/javascript">
	
	$(document).ready(function() {
		$("#tx").attr("src",$("#img").val());
		 $("#txx").change(function() {
		 	var current_src= this.files[0];
		 	preview_photo(current_src);
		 });
		  function preview_photo(pic){
		 	var file = new FileReader();
		 	file.readAsDataURL(pic);
		 	file.onload = function(e){
		 	//alert(this.result);
		 		$("#tx").attr("src",this.result).show();
		 	}
		 }
		 
	});
		
</script>
</html>
